document.addEventListener("DOMContentLoaded", function () {
    const shareItems = document.querySelectorAll('.footer-right-top-share li');
    const codeItems = document.querySelectorAll('.footer-right-top-code li');
    const codeWrap = document.querySelector('.footer-right-top-code_wrap');
    
    shareItems.forEach((shareItem, index) => {
        shareItem.addEventListener('mouseenter', function() {
            codeWrap.style.display = 'block'; // 显示二维码区域
            codeItems.forEach((codeItem, i) => {
                // 只显示当前对应的二维码
                if (i === index) {
                    codeItem.style.display = 'block';
                } else {
                    codeItem.style.display = 'none';
                }
            });
        });
        
        shareItem.addEventListener('mouseleave', function() {
            // 鼠标移开后隐藏二维码区域
            codeWrap.style.display = 'none';
            codeItems.forEach((codeItem) => {
                codeItem.style.display = 'none';
            });
        });
    });
});